package net.ipi.demo;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class OtherActivity extends Activity
{

	private static final String TAG = "demo";

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		Log.i(TAG, this.toString() + "...onCreate()");

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_other);

		Button btn = (Button) findViewById(R.id.otherBtn);

		btn.setOnClickListener(new OnClickListener()
		{

			@Override
			public void onClick(View v)
			{
				Intent intent = new Intent(OtherActivity.this,
						MainActivity.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(intent);

			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	protected void onStart()
	{
		Log.i(TAG, this.toString() + "...onStart()");
		super.onStart();
	}

	@Override
	protected void onResume()
	{
		Log.i(TAG, this.toString() + "...onResume()");
		super.onResume();
	}

	@Override
	protected void onStop()
	{
		Log.i(TAG, this.toString() + "...onStop()");
		super.onStop();
	}

	@Override
	protected void onRestart()
	{
		Log.i(TAG, this.toString() + "...onRestart()");
		super.onRestart();
	}

	@Override
	protected void onDestroy()
	{
		Log.i(TAG, this.toString() + "...onDestroy()");
		super.onDestroy();
	}

}
